package ch.uzh.ifi.seal.ssqa.util;

public class ValueNormalizer {
	/**
	 * Normalizes the given value to a result between 0 and 100
	 * @param value - Value to normalize
	 * @param max - MaxValue of the collection the value is in
	 * @param min - MinValue of the colleciton the value is in
	 * @return
	 */
	public static double normalizeValue(double value, double max, double min){
		if(value != 0){
			double maxNorm = 100;
			double minNorm = 0.1;
			return (value-min) *((maxNorm -minNorm)/(max-min)) +minNorm;
		} else {
			return 0;
		}
		
	}
}
